﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using HotelManagement.Class;

namespace HotelManagement
{
    public partial class CheckAvailableRoom : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnCheckVacantRoom_Click(object sender, EventArgs e)
        {
            if (BookingAndRoomAvailabilityDBManager.CheckVacantRoom("Vacant") == true)
            {
                lblVacantRoomStatus.Text = "Vacant rooms available.";
            }
            else
            {
                lblVacantRoomStatus.Text = "There are no vacant rooms.";
            }
        }

        protected void btnContinue_Click(object sender, EventArgs e)
        {
            string desiredArrivalDate = ddlDesiredArrivalDay.SelectedValue + "/" + ddlDesiredArrivalMonth.SelectedValue + "/" + tbxDesiredArrivalYear.Text;
            string desiredDepartDate = ddlDesiredDepartDay.SelectedValue + "/" + ddlDesiredDepartMonth.SelectedValue + "/" + tbxDesiredDepartYear.Text;
            

            string querystring = "desiredArrivalDate=" + desiredArrivalDate;
            querystring += "&" + "arrivalTime=" + tbxDesiredArrivalTime.Text;
            querystring += "&" + "desiredDepartDate=" + desiredDepartDate;
            querystring += "&" + "departTime=" + tbxDesiredDepartTime.Text;
            querystring += "&" + "numOfNight=" + tbxNight.Text;
            querystring += "&" + "numOfAdult=" + tbxAdult.Text;
            querystring += "&" + "numOfChildren=" + tbxChildren.Text;

           
            Server.Transfer("BookingPreferenceOfRoom.aspx?" + querystring);

        }

        protected void btnClear_Click(object sender, EventArgs e)
        {
            tbxDesiredArrivalYear.Text = "";
            tbxDesiredDepartYear.Text = "";
            tbxDesiredArrivalTime.Text = "";
            tbxDesiredDepartTime.Text = "";
            tbxNight.Text = "";
            tbxAdult.Text = "";
            tbxChildren.Text = "";
        }

        protected void btnGoBack_Click(object sender, EventArgs e)
        {
            Server.Transfer("ManageBookingModule.aspx");
        }
    }
}